home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 21 code / Custom GX Printer Drivers / CustomWriter GX 1.0.1 / OldApp.r < prev   
Encoding:
Text File  |  1995-05-03  |  5.8 KB  |  288 lines  |  [TEXT/MPS ]

  1. /* -----------------------------------------------------------------------------
  2.  
  3.     FILENAME
  4.         OldApp.r
  5.  
  6.     DESCRIPTION
  7.         Contains resource descriptions for old-application compatibility.
  8.  
  9.     COPYRIGHT
  10.         Copyright © 1995 Apple Computer, Inc.
  11.         All rights reserved.
  12.     
  13.     Modification history
  14.         05/03/95 - Dave Hersey -    Version 1.0.1 to fix some minor bugs in
  15.                                     CustomBufferingAndIO.c.
  16.  
  17.         01/14/95 - Dave Hersey -    Created from the shell of a hollowed-out
  18.                                     ImageWriter driver.
  19.  
  20.     NOTE: Relevant goodies are listed in MPW's "Mark" menu.
  21.  
  22. -------------------------------------------------------------------------------- */
  23.  
  24. #include "Types.r"
  25. #include "SysTypes.r"
  26. #include "PrintingResTypes.r"
  27. #include "CommonDefines.h"
  28.  
  29.  
  30. // This resource allows us to customize the old API's behavior - all drivers
  31. // should have a resource of this type
  32.  
  33. resource gxCustType (gxCustID, sysheap, purgeable)
  34. {
  35.     72, 72,                    // our best DPI
  36.     defaultUpDriver,        // we use the default up driver
  37.     {1, 1},                    // pattern stretch of 2
  38.     gxOptimizedTranslation + gxRasterTargetTranslation
  39. };
  40.  
  41.  
  42. // PrGeneral resolution resource.  We only support 72 dpi.
  43.  
  44. resource gxReslType (gxReslID, sysheap, purgeable)
  45. {
  46.     rangeType,
  47.     gxDiscreteResolution, gxDiscreteResolution,
  48.     gxDiscreteResolution, gxDiscreteResolution,
  49.     {
  50.         72, 72;
  51.     }
  52. };
  53.  
  54.  
  55. // Overrides for old application messages, and where to find them in the jump
  56. // table.
  57.  
  58. #define firstOffset 4
  59. #define segmentID     OldSegID
  60.  
  61. resource gxOverrideType (gxDriverCompatibilityOverrideID, sysheap, purgeable)
  62. {
  63.     {
  64.         gxConvertPrintRecordTo,            segmentID, firstOffset,
  65.         gxConvertPrintRecordFrom,        segmentID, firstOffset + 4,
  66.         gxPrValidate,                    segmentID, firstOffset + 8
  67.     };
  68. };
  69.  
  70.  
  71. // Page Setup dialog
  72.  
  73. resource 'dctb' (-8192, sysheap, purgeable) {
  74.     {    /* array ColorSpec: 0 elements */
  75.     }
  76. };
  77.  
  78. resource 'DLOG' (-8192, sysheap, purgeable) {
  79.     {30, 20, 174, 492},
  80.     dBoxProc,
  81.     invisible,
  82.     noGoAway,
  83.     0x1,
  84.     -8192,
  85.     "Stl",
  86.     noAutoCenter
  87. };
  88.  
  89. resource 'DITL' (-8192, sysheap, purgeable) {
  90.     {    /* array DITLarray: 18 elements */
  91.         /* [1] */
  92.         {8, 404, 27, 464},
  93.             Button { enabled, "OK" },
  94.             
  95.         /* [2] */
  96.         {35, 404, 54, 464},
  97.             Button { enabled, "Cancel" },
  98.             
  99.         /* [3] name frill */
  100.         {4, 4, 20, 384},
  101.             StaticText { disabled, DriverName },
  102.         
  103.         /* [4] line frill */
  104.         {20, 4, 24, 393},
  105.             UserItem { disabled },
  106.         
  107.         /* [5] */
  108.         {24, 4, 40, 60},
  109.             StaticText { disabled, "Paper:" },
  110.             
  111.         /* [6] */
  112.         {24, 68, 40, 208},
  113.             RadioButton { enabled, "¿" },
  114.             
  115.         /* [7] */
  116.         {24, 218, 40, 383},
  117.             RadioButton { enabled, "¿" },
  118.             
  119.         /* [8] */
  120.         {39, 68, 55, 208},
  121.             RadioButton { enabled, "¿" },
  122.             
  123.         /* [9] */
  124.         {39, 218, 55, 383},
  125.             RadioButton { enabled, "¿" },
  126.             
  127.         /* [10] */
  128.         {54, 68, 70, 208},
  129.             RadioButton { enabled, "¿" },
  130.             
  131.         /* [11] */
  132.         {54, 218, 70, 383},
  133.             RadioButton { enabled, "¿" },
  134.             
  135.         /* [12] */
  136.         {74, 4, 90, 88},
  137.             StaticText { disabled, "Orientation" },
  138.             
  139.         /* [13] portrait icon */
  140.         {93, 5, 125, 37},
  141.             UserItem { enabled },
  142.         
  143.         /* [14] landscape icon */
  144.         {93, 45, 125, 77},
  145.             UserItem { enabled },
  146.             
  147.         /* [15] version frill */
  148.         {4, 348, 19, 384},
  149.             UserItem { enabled },
  150.  
  151.         /* [16] default frill */
  152.         {4, 400, 24, 460},
  153.             UserItem { enabled },
  154.     }
  155. };
  156.  
  157. // Page Setup dialog dctl
  158. resource 'dctl' (-8192, sysheap, purgeable) {
  159.     16,
  160.     {
  161.         Button { 2, cancel },
  162.         Frill { 4, line },
  163.         PaperSizes { 0, 0, { 6, 7, 8, 9, 10, 11 } },
  164.         Orientation { 13, 14, 0, 0 },
  165.         Frill { 15, version },
  166.         Frill { 16, default },
  167.     }
  168. };
  169.  
  170. // Version string for old dialogs
  171. resource 'STR ' (-8190, sysheap, purgeable) { "1.0.1" };
  172.  
  173.  
  174. // Print Dialog
  175.  
  176. resource 'dctb' (-8191, sysheap, purgeable) {
  177.     {    /* array ColorSpec: 0 elements */
  178.     }
  179. };
  180.  
  181. resource 'DLOG' (-8191, sysheap, purgeable) {
  182.     {50, 20, 154, 492},
  183.     dBoxProc,
  184.     invisible,
  185.     noGoAway,
  186.     0x1,
  187.     -8191,
  188.     "Job",
  189.     noAutoCenter
  190. };
  191.  
  192. resource 'DITL' (-8191, sysheap, purgeable) {
  193.     {    /* array DITLarray: 19 elements */
  194.         /* [1] */
  195.         {8, 404, 27, 464},
  196.             Button { enabled, "Print" },
  197.         
  198.         /* [2] */
  199.         {35, 404, 54, 464},
  200.             Button { enabled, "Cancel" },
  201.             
  202.         /* [3] name frill */
  203.         {4, 4, 20, 384},
  204.             StaticText { disabled, DriverName },
  205.             
  206.         /* [4] line frill */
  207.         {20, 5, 24, 393},
  208.             UserItem { disabled },
  209.             
  210.         /* [5] */
  211.         {44, 4, 60, 88},
  212.             StaticText { disabled, "Page Range:" },
  213.             
  214.         /* [6] */
  215.         {44, 100, 60, 188},
  216.             RadioButton { enabled, "All" },
  217.             
  218.         /* [7] */
  219.         {44, 200, 60, 260},
  220.             RadioButton { enabled, "From:" },
  221.             
  222.         /* [8] */
  223.         {44, 264, 60, 296},
  224.             EditText { disabled, "" },
  225.             
  226.         /* [9] */
  227.         {44, 304, 60, 332},
  228.             StaticText { disabled, "To:" },
  229.             
  230.         /* [10] */
  231.         {44, 332, 60, 364},
  232.             EditText { disabled, "" },
  233.             
  234.         /* [11] */
  235.         {64, 4, 80, 88},
  236.             StaticText { disabled, "Copies:" },
  237.             
  238.         /* [12] */
  239.         {64, 100, 80, 132},
  240.             EditText { disabled, "1" },
  241.  
  242.         /* [13] version frill */
  243.         {4, 348, 19, 384},
  244.             UserItem { enabled },
  245.  
  246.         /* [14] default frill */
  247.         {4, 400, 24, 460},
  248.             UserItem { enabled }
  249.     }
  250. };
  251.  
  252. // Print dialog dctl
  253. resource 'dctl' (-8191, sysheap, purgeable) {
  254.     14,
  255.     {
  256.         Button { 2, cancel },
  257.         Frill { 4, line },
  258.         PageRange { 6, 7, 8, 10},
  259.         Copies { 12 },
  260.         Frill { 13, version },
  261.         Frill { 14, default },
  262.     }
  263. };
  264.  
  265.  
  266. // Our driver's default print record for old apps.  This is
  267. // loaded by the default implementation of gxPrintDefault.
  268.  
  269. data 'PREC' (0, sysheap, purgeable) {
  270.     $"000C"                    // print record version
  271.     $"0000"                    // iDev
  272.     $"0048 0048"            // horizontal and vertical resolution
  273.     $"0000 0000 02F0 0280"    // rPage
  274.     $"FFDC FFEC 02F4 0294"    // rPaper
  275.     $"8804"                    // wDev = 0x88, 0x04 == Portrait
  276.      
  277.     // Misc. values follow.  We use the same as the IW.
  278.     $"0528 03FC 0001"
  279.     $"0000"                    // iDev
  280.     $"0048 0048"            // horizontal and vertical resolution
  281.  
  282.      // More misc. settings follow.  We use the same as the IW.
  283.     $"0000 0000 02F0 0280 0050 0020 0280 0C80 0018 0001 0101 0000"
  284.     $"0001 270F 0001 0101 0000 0000 0000 0000 0000 0000 0000 0000"
  285.     $"0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000"
  286.     $"0000 0000 0000 0000 0000"
  287. };
  288.